package com.lz.water.monitor.util;

import java.io.Serializable;

import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;

public class ResponseEntityUtils {

	public static ResponseEntity<Body> success(Object data, int status,
			String msg) {
		return new ResponseEntity<ResponseEntityUtils.Body>(new Body(status,
				msg, data), HttpStatus.OK);
	}

	public static class Body implements Serializable {
		/**
		 * 
		 */
		private static final long serialVersionUID = -6385504117461979448L;
		private int status;
		private String msg;
		private Object data;

		public Body() {
			super();
		}

		public Body(int status, String msg, Object data) {
			super();
			this.status = status;
			this.msg = msg;
			this.data = data;
		}

		public int getStatus() {
			return status;
		}

		public void setStatus(int status) {
			this.status = status;
		}

		public String getMsg() {
			return msg;
		}

		public void setMsg(String msg) {
			this.msg = msg;
		}

		public Object getData() {
			return data;
		}

		public void setData(Object data) {
			this.data = data;
		}

	}
}
